package com.tledu.io;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class IO06 {
    public static void main(String[] args) {
        String fileName = "C:\\Users\\cyrus\\Desktop\\大数据17期\\study-java\\src\\com\\tledu\\io\\test";
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(fileName));
            while (true) {
                // readLine的api可以很方便的读取文件数据
                String line = reader.readLine();
                if (line == null) {
                    break;
                }
                System.out.println(line);
            }

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
